package cn.waqwb.my.shop.web.controller;

import cn.waqwb.my.shop.commons.context.SpringContext;
import cn.waqwb.my.shop.entity.User;
import cn.waqwb.my.shop.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class LoginController extends HttpServlet {
    @Autowired
    private UserService userService = (UserService) SpringContext.context.getBean("userService");
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        User login = userService.login("qiuwb@tedu.cn", "123123");
        System.out.println(login);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

    }
}
